//
//  DBDataFactory.h
//  CslpodDictionary
//
//  Created by gtts on 13-4-18.
//  Copyright (c) 2013年 cslpod. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabaseQueue.h"
#import "LKDaoBase.h"



typedef enum _ModelName
{
    kModelNameTest,
}ModelName;//这个是枚举是区别不同的实体,我这边就写一个test;

@interface DBDataFactory : NSObject

@property (nonatomic, strong) NSString *databasePath;

/**
 * 单例
 */
+ (DBDataFactory *)sharedDBDataFactory;

/**
 * 是否存在数据库
 */
- (BOOL)isExistDB;

/**
 * 创建数据库
 */
- (void)createDB;

/**
 * 创建表
 */
- (void)createTable:(Class)modelClass;

/**
 * 添加数据
 */
- (void)insertIntoDB:(id)model classType:(Class)modelClass;

/**
 *修改数据
 */
- (void)updateData:(id)model classType:(Class)modelClass;

/**
 * 删除单条数据
 */
- (void)deleteData:(id)model classType:(Class)modelClass;

/**
 * 删除表的数据
 */
- (void)clearTableData:(Class)modelClass;

/**
 * 根据条件删除数据
 */
- (void)deleteWhereData:(NSDictionary *)model classType:(Class)modelClass;

/**
 * 查找数据
 */
- (void)searchWhere:(NSDictionary *)where orderBy:(NSString *)columeName offset:(int)offset count:(int)count classType:(Class)modelClass callback:(void(^)(NSArray *))result;

@end
